#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int EF(int* left, int* right, int h)
{
    int k = 0; int* f = left;
    while (left <= right)
    {
        int c = (int)(right - left) / 2;
        if (*(left + c) > h)
        {
            right = left + c - 1;
        }
        else if (*(left + c) < h)
        {
            left = left + c + 1;
        }
        else
        {
            return (int)(left + c - f);
        }
    }
    return -1;
}
int main()
{
    int arr[10] = { 0 };
    int i = 0; int j = 0;
    for (i = 0; i < 10; i++)
    {
        scanf("%d",&arr[i]);
    }
    scanf("%d",&j);
    int ret = sizeof(arr) / sizeof(arr[0]);
    int g = EF(arr, &arr[ret - 1],j);
    printf("%d", g);
    return 0;
}